package com.prs.crm.domain.hr;

import javax.persistence.Entity;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.FlowCodeEntity;


@Entity
@Table(name="hr_train")
public class Train extends FlowCodeEntity{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	private String traincode;
	@ManyToOne
	private TrainItem item;
	@ManyToOne
	private Person trainPerson;
	private String perid;
	private String cost;
	private String result;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
	private Attachment attach;
	@Column(name="train_file")
	private String train_file;

	//private String attach;
	
	private String state;
	@Lob
	private String remark;
	private String title;
	private TrainItem trainItem;
	
//	@OneToOne(fetch=FetchType.LAZY,mappedBy="person")
//	private Code code;
	public TrainItem getTrainItem() {
		return trainItem;
	}
	public void setTrainItem(TrainItem trainItem) {
		this.trainItem = trainItem;
	}
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public TrainItem getItem() {
		return item;
	}
	public void setItem(TrainItem item) {
		this.item = item;
	}
	public Person getTrainPerson() {
		return trainPerson;
	}
	public void setTrainPerson(Person trainPerson) {
		this.trainPerson = trainPerson;
	}
	public String getPerid() {
		return perid;
	}
	public void setPerid(String perid) {
		this.perid = perid;
	}
	public String getCost() {
		return cost;
	}
	public void setCost(String cost) {
		this.cost = cost;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTitle() {
		return title;
	}
	public String getTraincode() {
		return traincode;
	}
	public void setTraincode(String traincode) {
		this.traincode = traincode;
	}
//	public Code getCode() {
//		return code;
//	}
//	public void setCode(Code code) {
//		this.code = code;
//	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getTrain_file() {
		return train_file;
	}
	public void setTrain_file(String trainFile) {
		train_file = trainFile;
	}
	
	
}
